<?php /* Smarty version 2.6.18, created on 2015-11-12 17:37:52
         compiled from gm_selectUserInfo.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "top.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "left.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<style>
.table {
    margin-bottom: 5px;
}

.alert {
    margin-bottom: 10px;
}
body,h1,p,blockquote,dl,dt,dd,ul,ol,li,input{margin:0;padding:0;} 
.autoDis{border:1px solid #999;position:absolute;overflow:hidden;} 
.autoDis p{line-height:25px;cursor:default;padding:0 5px;} 
.autoDis li{line-height:25px;cursor:default;padding:0 5px;background-color:#fff;} 
.autoDis .cur{background:#ccc;} 

input[type=checkbox].ace, input[type=radio].ace {
opacity: 0;
position: absolute;
z-index: 12;
width: 18px;
height: 20px;
cursor: pointer;
}

.table-header {
background-color: #307ecc;
color: #FFF;
font-size: 14px;
line-height: 35px;
padding-left: 12px;
margin-bottom: 1px;
padding-bottom:2px;
}

.comments {  
 width:100%;/*自动适应父布局宽度*/  
 overflow:auto;  
 word-break:break-all; 
 border-color:#307ecc;
 float:left;
 }
 
.table th, .table td { 
	text-align: center; 
}
</style>
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs"><script
	type="text/javascript">
	try {
		ace.settings.check('breadcrumbs', 'fixed')
	} catch (e) {
	}
</script>

<ul class="breadcrumb">
	<li><i class="icon-home home-icon"></i> <a
		href="index.php">首页</a></li>
</ul>
<!-- .breadcrumb --></div>
<div class ="col-lg-2" >
</div>
<div class="page-content col-lg-8 col-md-12 col-sm-12 col-xs-12">
<div class="col-xs-12">

<div  class="alert alert-info col-lg-12 col-md-12 col-sm-12 col-xs-12">
<form class="form-horizontal" role="form">
<div class="row">
<div class="col-sm-6">
<div class="row">
<label class="col-sm-6 control-label no-padding-right" for="form-field-5">游戏</label>
<div class="col-sm-3"><select id="selectGame">
	<option value="" >游戏</option>
	<?php if ($this->_tpl_vars['selectGames']): ?> <?php $_from = $this->_tpl_vars['selectGames']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
	<?php if ($this->_tpl_vars['nowGame'] == $this->_tpl_vars['value']): ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php else: ?>
	<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
	<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
</select>
</div>
</div>
</div>

<div class="col-sm-6">
<div class="row">
<label class="col-sm-3 control-label no-padding-right" for="form-field-5">区服</label>
<div class="col-sm-3">
<select style="width:120px;" id="selectServer">
	<option value="" id="server">区服</option>
	
	<?php if ($this->_tpl_vars['serverLists']): ?> <?php $_from = $this->_tpl_vars['serverLists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['serverList']):
?>
	<?php if ($this->_tpl_vars['nowServer'] == $this->_tpl_vars['serverList']['server']): ?>
	<option value="<?php echo $this->_tpl_vars['serverList']['server']; ?>
" selected><?php echo $this->_tpl_vars['serverList']['server']; ?>
</option>
	<?php else: ?>
	<option value="<?php echo $this->_tpl_vars['serverList']['server']; ?>
"><?php echo $this->_tpl_vars['serverList']['server']; ?>
</option>
	<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
	
</select>
</div>
</div>
</div>
</div>
</form>
</div>

</div>

<div  class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div align="left" style="width:100%" id ="servers2" class="table-header">
<button id="view_1" type="button" onClick="view1();"
	class="width-10 btn btn-sm btn-primary">信息修改
</button>

<?php if ($this->_tpl_vars['userNode_10005'] && $this->_tpl_vars['userNode_10005'] == 10005): ?>

<button id="view_2" type="button" onClick="view2();"
	class="width-10 btn btn-sm btn-primary">用户操作
</button>

<button id="view_3" type="button" onClick="view3();"
	class="width-10 btn btn-sm btn-primary">服务器操作
</button>

<button id="view_4" type="button" onClick="view4();"
	class="width-10 btn btn-sm btn-primary">批量补偿
</button>

<?php endif; ?>

</div>
</div>


<div id="view4" style="display:none" class="col-xs-12">
<center>
<table style="width:100%;" id="sample-table-1" class="table table-striped table-bordered table-hover">

<?php if ($this->_tpl_vars['channel_0']): ?>
<tr>
<td>
<form>
<div align="left" class="form-group list-inline">
     <label class="col-sm-2 control-label no-padding-right" for="form-field-2">平台：<?php echo $this->_tpl_vars['channel_0']; ?>
</label>
    <input  name="checkboxs_all" type="checkbox" class="ace ace-checkbox-2 " id="<?php echo $this->_tpl_vars['channel_0']; ?>
_selectAll" value="全选/反选">
    <label  class="lbl " for="ace-settings-navbar">&nbsp;全选/反选</label>
    
    <!--  
    <input name="checkboxs_all" type="checkbox" class="ace ace-checkbox-2" id="<?php echo $this->_tpl_vars['channel_0']; ?>
_selectAll" value="全选/反选">
    <label style="width:100px;" class="lbl col-sm-2" for="ace-settings-navbar">全选/反选</label>
     -->
     
</div>
</form>
</td>
</tr>
<tr>
<td>
<form>
	<div id="<?php echo $this->_tpl_vars['channel_0']; ?>
" align="left" class="form-group">
		<?php if ($this->_tpl_vars['serverLists']): ?>
		<?php $_from = $this->_tpl_vars['serverLists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['server']):
?>
		 
		 <?php if ($this->_tpl_vars['server']['platform'] == $this->_tpl_vars['channel_0']): ?>
		 <input  name="checkboxs" type="checkbox" class="ace ace-checkbox-2" id="game_<?php echo $this->_tpl_vars['server']['server']; ?>
"   value = "<?php echo $this->_tpl_vars['server']['server']; ?>
" />
		 <label style="width:110px;" class="lbl" for="ace-settings-navbar"><?php echo $this->_tpl_vars['server']['server']; ?>
</label>
		 	
		 <?php if ($this->_tpl_vars['server']['serverId'] > 0 && $this->_tpl_vars['server']['serverId']%7 == 0): ?>
		   <br/> 
		 <?php endif; ?>
		 
		 <?php endif; ?>
		
		<?php endforeach; endif; unset($_from); ?>
		<?php endif; ?>	
	</div>	
</form>
</td>
</tr>
<?php endif; ?>

<?php if ($this->_tpl_vars['channel_1']): ?>
<tr>
<td>
<div align="left" class="form-group">
<label class="col-sm-2 control-label no-padding-right" for="form-field-5">平台：<?php echo $this->_tpl_vars['channel_1']; ?>
</label>
	<input  name="checkboxs_all" type="checkbox" class="ace ace-checkbox-2" id="<?php echo $this->_tpl_vars['channel_1']; ?>
_selectAll"   value = "全选" />
	<label style="width:100px;" class="lbl" for="ace-settings-navbar">&nbsp;全选/反选</label>
</div>
</td>
</tr>
<tr>
<td>
<form>
	<div id="<?php echo $this->_tpl_vars['channel_1']; ?>
" align="left" class="form-group">
		<?php if ($this->_tpl_vars['serverLists']): ?>
		<?php $_from = $this->_tpl_vars['serverLists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['server']):
?>
	  	
		<?php if ($this->_tpl_vars['server']['platform'] == $this->_tpl_vars['channel_1']): ?>
			<input  name="checkboxs" type="checkbox" class="ace ace-checkbox-2" id="game_<?php echo $this->_tpl_vars['server']['server']; ?>
"   value = "<?php echo $this->_tpl_vars['server']['server']; ?>
" />
			<label style="width:110px;" class="lbl" for="ace-settings-navbar"><?php echo $this->_tpl_vars['server']['server']; ?>
</label>
		
			<?php if ($this->_tpl_vars['server']['serverId'] > 0 && $this->_tpl_vars['server']['serverId']%7 == 0): ?>
		  	   <br/> 
			<?php endif; ?>
		<?php endif; ?>
		
		<?php endforeach; endif; unset($_from); ?>
		<?php endif; ?>	
	</div>	
</form>
</td>
</tr>
<?php endif; ?>

<?php if ($this->_tpl_vars['channel_2']): ?>
<tr>
<td>
<div  align="left" class="form-group">
<label class="col-sm-1 control-label no-padding-right" for="form-field-5"><?php echo $this->_tpl_vars['channel_2']; ?>
</label>
		<input  name="checkboxs_all" type="checkbox" class="ace ace-checkbox-2" id="<?php echo $this->_tpl_vars['channel_2']; ?>
_selectAll"   value = "全选" />
	<label style="width:100px;" class="lbl" for="ace-settings-navbar">&nbsp;全选/反选</label>
</div>
</td>
</tr>
<tr>
<td>
<form>
	<div id="<?php echo $this->_tpl_vars['channel_2']; ?>
" align="left" class="form-group">
		<?php if ($this->_tpl_vars['serverLists']): ?>
		<?php $_from = $this->_tpl_vars['serverLists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['server']):
?>
		
		 <?php if ($this->_tpl_vars['server']['platform'] == $this->_tpl_vars['channel_2']): ?>
		<input  name="checkboxs" type="checkbox" class="ace ace-checkbox-2" id="game_<?php echo $this->_tpl_vars['server']['server']; ?>
"   value = "<?php echo $this->_tpl_vars['server']['server']; ?>
" />
		<label style="width:110px;" class="lbl" for="ace-settings-navbar"><?php echo $this->_tpl_vars['server']['server']; ?>
</label>
			<?php if ($this->_tpl_vars['server']['serverId'] > 0 && $this->_tpl_vars['server']['serverId']%7 == 0): ?>
		      <br/> 
		   <?php endif; ?>
		<?php endif; ?>
		
		<?php endforeach; endif; unset($_from); ?>
		<?php endif; ?>	
	</div>	
</form>
</td>
</tr>
<?php endif; ?>





<?php if ($this->_tpl_vars['channel_3']): ?>
<tr>
<td>
<div  align="left" class="form-group">
<label class="col-sm-1 control-label no-padding-right" for="form-field-5"><?php echo $this->_tpl_vars['channel_3']; ?>
</label>
		<input  name="checkboxs_all" type="checkbox" class="ace ace-checkbox-2" id="<?php echo $this->_tpl_vars['channel_3']; ?>
_selectAll"   value = "全选" />
	<label style="width:100px;" class="lbl" for="ace-settings-navbar">&nbsp;全选/反选</label>
</div>
</td>
</tr>
<tr>
<td>
<form>
	<div id="<?php echo $this->_tpl_vars['channel_3']; ?>
" align="left" class="form-group">
		<?php if ($this->_tpl_vars['serverLists']): ?>
		<?php $_from = $this->_tpl_vars['serverLists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['server']):
?>
		
		 <?php if ($this->_tpl_vars['server']['platform'] == $this->_tpl_vars['channel_3']): ?>
		<input  name="checkboxs" type="checkbox" class="ace ace-checkbox-2" id="game_<?php echo $this->_tpl_vars['server']['server']; ?>
"   value = "<?php echo $this->_tpl_vars['server']['server']; ?>
" />
		<label style="width:110px;" class="lbl" for="ace-settings-navbar"><?php echo $this->_tpl_vars['server']['server']; ?>
</label>
			<?php if ($this->_tpl_vars['server']['serverId'] > 0 && $this->_tpl_vars['server']['serverId']%7 == 0): ?>
		      <br/> 
		   <?php endif; ?>
		<?php endif; ?>
		
		<?php endforeach; endif; unset($_from); ?>
		<?php endif; ?>	
	</div>	
</form>
</td>
</tr>
<?php endif; ?>


</table>
</center>
</div>

<form id="view5" class="form-horizontal" role="form">


<div  class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<table  id="sample-table-1" class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th>查询条件</th>
			<th>查询信息</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
	
		<tr>
			<td>角色名</td>
			<td> 
			<div class="col-sm-12">
				<input type="text" id="user_role" placeholder="角色名"  class="col-xs-6 col-sm-9" value="<?php echo $this->_tpl_vars['role']; ?>
">
			</div>
			</td>	
			<td><center>
				<button valign="bottom" type="button" onclick="selectRole('role');" class="btn   btn-primary btn-sm" >
							查询
				</button>
				</center>
			</td>
		</tr>
		
				<tr>
			<td>Puid</td>
			<td> 
			<div class="col-sm-12">
				<input type="text" id="user_puid" placeholder="puid"  class="col-xs-6 col-sm-9" value="<?php echo $this->_tpl_vars['puid']; ?>
">
			</div>
			</td>	
			<td><center>
				<button valign="bottom" type="button" onclick="selectRole('puid');" class="btn   btn-primary btn-sm">
							查询
				</button>
				</center>
			</td>
		</tr>
		
				<tr>
			<td>用户id</td>
			<td> 
			<div class="col-sm-12">
				<input type="text" id="user_id" placeholder="playerId"  class="col-xs-6 col-sm-9" value="<?php echo $this->_tpl_vars['playerid']; ?>
">
			</div>
			</td>	
			<td><center>
				<button valign="bottom" type="button" onclick="selectRole('id');" class="btn   btn-primary btn-sm">
							查询
				</button>
				</center>
			</td>
		</tr>

	</tbody>
</table>
</div>
</form>


<div align="center"  class="col-xs-12">

<!-- 
<div align="left" style="width:100%" id ="servers2" class="table-header">

<button type="button" onClick="view1();"
	class="width-10 btn btn-sm btn-primary">信息修改
</button>

<button type="button" onClick="view2();"
	class="width-10 btn btn-sm btn-primary">用户操作
</button>

<button type="button" onClick="view3();"
	class="width-10 btn btn-sm btn-primary">服务器操作
</button>

</div>


style="height:650px;overflow-x:auto;overflow-y:auto;"
-->


<div  id="view1"  class="table-responsive">
<center>
<div  style="width:100%;" class="table-header"> 
用户信息查询
</div>
</center>

<center>
<table style="width:100%"  id="sample-table-1"
	class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th>key</th>
			<th>value</th>
			<th>修改值</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		<?php $_from = $this->_tpl_vars['viewData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['viewData']):
?>
		<tr>
			<td  style="width:30%""><?php echo $this->_tpl_vars['viewData']['key']; ?>
</td>
			<td  style="width:30%"><input type="text" id="key_<?php echo $this->_tpl_vars['viewData']['key']; ?>
" value="<?php echo $this->_tpl_vars['viewData']['value']; ?>
" disabled="disabled" class="col-xs-6 col-sm-9"></td>
			
			<?php if ($this->_tpl_vars['viewData']['isChange'] == 1 && $this->_tpl_vars['userNode_10005'] == 10005): ?>
			<td  style="width:20%"><input type="text" id="value_<?php echo $this->_tpl_vars['viewData']['key']; ?>
"  value="" class="col-xs-6 col-sm-9"></td>
			<td  style="width:20%">
				 <button valign="bottom" type="button" onclick="changeRoleInfo('<?php echo $this->_tpl_vars['viewData']['key']; ?>
','value_<?php echo $this->_tpl_vars['viewData']['key']; ?>
');" class="btn   btn-primary btn-sm">
							修改
				</button>
			</td>
			<?php else: ?>
			<td  style="width:20%">-</td>
			<td  style="width:20%">
							-
			</td>
			<?php endif; ?>	
		<?php endforeach; endif; unset($_from); ?>
	</tbody>
</table>
</center>
</div>

<div  id="view2"  style="display:none" class="table-responsive">
<center>
<div  style="width:100%;" class="table-header"> 
用户操作
</div>
</center>

<center>
<table  style="width:100%;"  id="sample-table-1"
	class="table table-striped table-bordered table-hover">
	
	
		<thead>
	<tr>
			<th style="text-align:left" colspan="6">发送奖励</th>
	</tr>
	</thead>
	<tr>		
			
			<style>
		/*		  textarea {
				       outline: thin dotted #F59942;
				   }
		*/
			</style>
			
			<td colspan="5">
			<!--  	<textarea class="comments" style="border-color:#D5D5D5" placeholder="消息" id="awardMsg"  rows="3" name="s1" cols="40" onpropertychange="this.style.posHeight=this.scrollHeight"></textarea>-->
			  	 
			  	 <input type="text" id="awardMsg" placeholder="消息" class="col-xs-12 col-sm-12">   
			</td>
			
			
			<td rowspan="3">
				 <button style="margin-top:45px;" valign="bottom" type="button" onclick="sendAward();" class="btn btn-primary btn-sm">
							发送
				</button>
			</td>
	</tr>	
	
	
	<tr>		
			
			<style>
		/*		  textarea {
				       outline: thin dotted #F59942;
				   }
		*/
			</style>
			
	
			<td colspan="5">
		<!--		<textarea placeholder="奖励内容" style="border-color:#D5D5D5" id="awardInfo" class="comments" rows="3" name="s1" cols="10" onpropertychange="this.style.posHeight=this.scrollHeight"></textarea> -->
		  		 <input type="text" id="awardInfo" placeholder="(奖励内容)可手动输入奖励内容或使用下方菜单添加奖励" class="col-xs-12 col-sm-12">  
			</td>
			
			
	</tr>	
	
	<tr>
		<td colspan="1">
				<select id="itemType1">
	<option value="">类别</option>
		<?php if ($this->_tpl_vars['gm_awardsinfo']): ?> <?php $_from = $this->_tpl_vars['gm_awardsinfo']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['data']):
?>
		<?php if ($this->_tpl_vars['nowAttr'] == $this->_tpl_vars['data']['id']): ?>
		<option value="<?php echo $this->_tpl_vars['data']['id']; ?>
" selected><?php echo $this->_tpl_vars['data']['name']; ?>
</option>
		<?php else: ?>
		<option value="<?php echo $this->_tpl_vars['data']['id']; ?>
"><?php echo $this->_tpl_vars['data']['name']; ?>
</option>
		<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
	</select>
		</td>
		<td colspan="1">
    <select style="width:120px;" id="itemTools1">
	<option value="" >物品</option>
	</select>
		
		</td>
		<td colspan="1">
		 <input type="text" id="itemNum1" placeholder="数量" class="col-xs-6 col-sm-6">
		</td>
		<td colspan="1">
		<button  valign="bottom" type="button" onclick="addItems(1);" class="btn btn-primary btn-sm">
				添加
		</button>
		</td>
		<td colspan="1">
		<button  valign="bottom" type="button" onclick="removeItems(1);" class="btn btn-primary btn-sm">
				重置
		</button>
		</td>
	</tr>
	
	
	
	
	<thead>
		<tr>
			<th style="text-align:left" colspan="6">用户充值(根据商品id)</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			
<!--				
			<td>
				<select id="selectChannel1">
	<option value="" >渠道</option>
		<?php if ($this->_tpl_vars['channelInfo']): ?> <?php $_from = $this->_tpl_vars['channelInfo']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
		<?php if ($this->_tpl_vars['nowChannel'] == $this->_tpl_vars['value']): ?>
		<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
		<?php else: ?>
		<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
		<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
	</select>
			</td>
-->			
			
			<td colspan="5">
				 <input type="text" id="goodsId"  placeholder="goodsId" class="col-xs-6 col-sm-6">
			</td>
			
			<td>
				 <button valign="bottom" type="button" onclick="recharge('id');" class="btn   btn-primary btn-sm">
							充值
				</button>
			</td>
	</tr>
	
	<thead>
	<tr>
			<th style="text-align:left" colspan="6">用户充值(任意金额)</th>
	</tr>
	</thead>
	<tr>
			
<!--				
			<td>
				<select id="selectChannel2">
	<option value="" >渠道</option>
		<?php if ($this->_tpl_vars['channelInfo']): ?> <?php $_from = $this->_tpl_vars['channelInfo']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
		<?php if ($this->_tpl_vars['nowChannel'] == $this->_tpl_vars['value']): ?>
		<option value="<?php echo $this->_tpl_vars['value']; ?>
" selected><?php echo $this->_tpl_vars['value']; ?>
</option>
		<?php else: ?>
		<option value="<?php echo $this->_tpl_vars['value']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</option>
		<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
	</select>
			</td>
-->			
			
			
			<td colspan="3">
				 <input type="text" id="orderId" placeholder="订单号" class="col-xs-6 col-sm-9">
			</td>
			
			<td colspan="2">
				 <input type="text" id="rechargeMoney" placeholder="充值金额" class="col-xs-6 col-sm-9">
			</td>
			
			<td>
				 <button valign="bottom" type="button" onclick="recharge('order');" class="btn   btn-primary btn-sm">
							充值
				</button>
			</td>
	</tr>
	
	
	
	
	
	
<!--  	
	<thead>
	<tr>
			<th colspan="6">添加装备</th>
	</tr>
	</thead>
	<tr>
			
			<td colspan="2">
				 <input type="text" id="equipId" placeholder="装备id" class="col-xs-6 col-sm-9">
			</td>
	
			<td>
				 <input type="text" id="equipNum" placeholder="装备数量" class="col-xs-6 col-sm-9">
			</td>
			
			<td>
				 <input type="text" id="starlevel1" placeholder="starlevel1" class="col-xs-6 col-sm-9">
			</td>
			
			<td>
				 <input type="text" id="starlevel2" placeholder="starlevel2" class="col-xs-6 col-sm-9">
			</td>
			
			<td>
				 <button valign="bottom" type="button" onclick="addEquip();" class="btn   btn-primary btn-sm">
							添加
				</button>
			</td>
	</tr>
-->	
	
	<thead>
	<tr>
			<th style="text-align:left" colspan="6">公会会长转让</th>
	</tr>
	</thead>
	<tr>
			<!--  
			<td colspan="2">
				 <input type="text" id="" placeholder="军团id" disabled="disabled"  class="col-xs-6 col-sm-9">
			</td>
			-->
			<td colspan="3">
				 <input type="text" id="allianceId_1" placeholder="allianceId"  class="col-xs-6 col-sm-9">
			</td>
			
			<!-- 
			<td>
				 <input type="text" id="" placeholder="会长id" disabled="disabled"  class="col-xs-6 col-sm-9">
			</td>
			-->
			<td colspan="2">
				 <input type="text" id="leaderId" placeholder="leaderId" class="col-xs-6 col-sm-9">
			</td>
			
			<td>
				 <button valign="bottom" type="button" onclick="changeLeader();" class="btn   btn-primary btn-sm">
							转让
				</button>
			</td>
	</tr>
	
	</tbody>
</table>

<table  style="width:100%;"  id="sample-table-1"
	class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th style="text-align:left" colspan="<?php echo $this->_tpl_vars['num']; ?>
">单个用户操作</th>
		</tr>
	</thead>
	<tbody>
		<tr>
		
		<?php if ($this->_tpl_vars['userOperation']): ?>
		<?php $_from = $this->_tpl_vars['userOperation']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['userOperation']):
?> 
			<td>
				 <button valign="bottom" type="button" onclick="userOperation(<?php echo $this->_tpl_vars['userOperation']['id']; ?>
);" class="btn   btn-primary btn-sm">
							<?php echo $this->_tpl_vars['userOperation']['desc']; ?>

				</button>
			</td>
		<?php endforeach; endif; unset($_from); ?>
		<?php endif; ?>
	</tbody>
</table>
</center>
</div>


<div  id="view3"  style="display:none" class="table-responsive">
<center>
<div  style="width:100%;" class="table-header"> 
服务器操作
</div>
</center>


<center>
<table  style="width:100%;"  id="sample-table-1"
	class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th style="text-align:left" colspan="6">全服邮件</th>
		</tr>
	</thead>
		
		<tr>
			<td colspan="5" >
		  		 <input type="text" id="test_playerId" placeholder="测试playerIds(多个用,隔开)" value="<?php echo $this->_tpl_vars['test_playerId']; ?>
" class="col-xs-12 col-sm-12">  
			</td>
			
			<td  rowspan="4">
				 <button style="margin-top:15px;" valign="bottom" type="button" onclick="selectOneUserInfo();" class="btn   btn-primary btn-sm">
							查询用户
				</button>
					<br/>
				 <button style="margin-top:15px;" valign="bottom" type="button" onclick="sendMulUserAwardTest();" class="btn   btn-primary btn-sm">
							发送测试
				</button>
					<br/>
				 <button style="margin-top:15px;margin-left:-5px;" valign="bottom" type="button" onclick="javascript:if(confirm('确认发送全服邮件吗?'))sendServerAward();" class="btn   btn-primary btn-sm">
							发送全服
				</button>
			</td>
			
		</tr>
	
		<tr>
			
			<td colspan="5" >
		  		 <input type="text" id="server_awardMsg" placeholder="消息" class="col-xs-12 col-sm-12">  
			</td>
	
        </tr>
        
        
        	<tr>
	
			<td colspan="5" >
			<!--	 <textarea class="comments" style="border-color:#D5D5D5" placeholder="奖励内容" id="server_awardInfo"  rows="3" name="s1" cols="10" onpropertychange="this.style.posHeight=this.scrollHeight"></textarea> -->
			  	 <input type="text" id="server_awardInfo" placeholder="(奖励内容)可手动输入奖励内容或使用下方菜单添加奖励" class="col-xs-12 col-sm-12">   
			</td>
			
			
        </tr>
        
       <tr>
		<td colspan="1">
				<select id="itemType2">
	<option value="">类别</option>
		<?php if ($this->_tpl_vars['gm_awardsinfo']): ?> <?php $_from = $this->_tpl_vars['gm_awardsinfo']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['data']):
?>
		<?php if ($this->_tpl_vars['nowAttr'] == $this->_tpl_vars['data']['id']): ?>
		<option value="<?php echo $this->_tpl_vars['data']['id']; ?>
" selected><?php echo $this->_tpl_vars['data']['name']; ?>
</option>
		<?php else: ?>
		<option value="<?php echo $this->_tpl_vars['data']['id']; ?>
"><?php echo $this->_tpl_vars['data']['name']; ?>
</option>
		<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
	</select>
		</td>
		<td colspan="1">
    <select style="width:120px;" id="itemTools2">
	<option value="" >物品</option>
	</select>
		
		</td>
		<td colspan="1">
		 <input type="text" id="itemNum2" placeholder="数量" class="col-xs-6 col-sm-6">
		</td>
		<td colspan="1">
		<button  valign="bottom" type="button" onclick="addItems(2);" class="btn btn-primary btn-sm">
				添加
		</button>
		</td>
		<td colspan="1">
		<button  valign="bottom" type="button" onclick="removeItems(2);" class="btn btn-primary btn-sm">
				重置
		</button>
		</td>
	</tr>
        
	<thead>
		<tr>
			<th>playerId</th>
			<th>puid</th>
			<th>playerName</th>
			<th>level</th>
			<th>isOnline</th>
			<th>status</th>
		</tr>
	</thead>
	<tbody>
		<?php $_from = $this->_tpl_vars['test_playerInfos']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['playerInfo']):
?>
		<tr>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['id']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['puid']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['name']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['level']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['isOnline']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['status']; ?>
</td>
		<tr/>	
		<?php endforeach; endif; unset($_from); ?>
	</tbody>


	<thead>
		<tr>
			<th style="text-align:left" colspan="6">全服聊天公告</th>
		</tr>
	</thead>
		<tr>
			<td colspan="5">
				 <input type="text" id="broadcast_chat" placeholder="聊天公告" class="col-xs-6 col-sm-12">
			</td>
	
			<td>
				 <button valign="bottom" type="button" onclick="broadcast('chat');" class="btn   btn-primary btn-sm">
							发送
				</button>
			</td>
			
        </tr>		
	
		<thead>
		<tr>
			<th style="text-align:left" colspan="6">全服广播公告</th>
		</tr>
	</thead>
		<tr>
			<td colspan="5">
				 <input type="text" id="broadcast_broad" placeholder="广播公告" class="col-xs-6 col-sm-12">
			</td>
	
			<td>
				 <button valign="bottom" type="button" onclick="broadcast('broad');" class="btn   btn-primary btn-sm">
							发送
				</button>
			</td>
			
        </tr>	
	
	<thead>
		<tr>
			<th  style="text-align:left" colspan="6">服务器操作</th>
		</tr>
	</thead>
	<tbody>
		<tr>
		
		<?php if ($this->_tpl_vars['serverOperation']): ?>
		<?php $_from = $this->_tpl_vars['serverOperation']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['serverOperation']):
?> 
			<td colspan="2" >
				 <button valign="bottom" type="button" onclick="serverOperation(<?php echo $this->_tpl_vars['serverOperation']['id']; ?>
);" class="btn   btn-primary btn-sm">
							<?php echo $this->_tpl_vars['serverOperation']['desc']; ?>

				</button>
			</td>
		<?php endforeach; endif; unset($_from); ?>
		<?php endif; ?>
		</tr>
		<tr>
		<td colspan="6" style="width:100%;"> <textarea placeholder="执行结果" id="result" class="comments" rows="2" name="s1" cols="50" onpropertychange="this.style.posHeight=this.scrollHeight"></textarea>
		</td>
		</tr>
	</tbody>
</table>

</center>
</div>






<div  id="view6"  style="display:none" class="table-responsive">
<center>
<div  style="width:100%;" class="table-header"> 
批量补偿
</div>
</center>


<center>
<table  style="width:100%;"  id="sample-table-1"
	class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th style="text-align:left" colspan="6">批量补偿邮件</th>
		</tr>
	</thead>
		<tr>
			<td colspan="5" >
		  		 <input type="text" id="mul_playerId" placeholder="playerId(用,隔开)" value="<?php echo $this->_tpl_vars['playerIds']; ?>
" class="col-xs-12 col-sm-12">  
			</td>
	
			<td  rowspan="4">
					
				<button style="margin-top:10px;" valign="bottom" type="button" onclick="selectMulUserInfo();" class="btn   btn-primary btn-sm">
							查询
				</button>	
			<br/>
				 <button style="margin-top:40px;" valign="bottom" type="button" onclick="sendMulUserAward();" class="btn   btn-primary btn-sm">
							发送
				</button>
			</td>
			
        </tr>
      <tr>
	
			<td colspan="5" >
			<!--	 <textarea class="comments" style="border-color:#D5D5D5" placeholder="奖励内容" id="server_awardInfo"  rows="3" name="s1" cols="10" onpropertychange="this.style.posHeight=this.scrollHeight"></textarea> -->
			  	 <input type="text" id="mul_awardMsg" placeholder="补偿说明" class="col-xs-12 col-sm-12">   
			</td>
			
        </tr>
        
        
        	<tr>
			<td colspan="5" >
			<!--	 <textarea class="comments" style="border-color:#D5D5D5" placeholder="奖励内容" id="server_awardInfo"  rows="3" name="s1" cols="10" onpropertychange="this.style.posHeight=this.scrollHeight"></textarea> -->
			  	 <input type="text" id="mul_awardInfo" placeholder="(奖励内容)可手动输入奖励内容或使用下方菜单添加奖励" class="col-xs-12 col-sm-12">   
			</td>
        	</tr>
        	
        	
        	<tr>
		<td colspan="1">
				<select id="itemType3">
	<option value="">类别</option>
		<?php if ($this->_tpl_vars['gm_awardsinfo']): ?> <?php $_from = $this->_tpl_vars['gm_awardsinfo']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['data']):
?>
		<?php if ($this->_tpl_vars['nowAttr'] == $this->_tpl_vars['data']['id']): ?>
		<option value="<?php echo $this->_tpl_vars['data']['id']; ?>
" selected><?php echo $this->_tpl_vars['data']['name']; ?>
</option>
		<?php else: ?>
		<option value="<?php echo $this->_tpl_vars['data']['id']; ?>
"><?php echo $this->_tpl_vars['data']['name']; ?>
</option>
		<?php endif; ?> <?php endforeach; endif; unset($_from); ?> <?php endif; ?>
	</select>
		</td>
		<td colspan="1">
    <select style="width:120px;" id="itemTools3">
	<option value="" >物品</option>
	</select>
		
		</td>
		<td colspan="1">
		 <input type="text" id="itemNum3" placeholder="数量" class="col-xs-6 col-sm-6">
		</td>
		<td colspan="1">
		<button  valign="bottom" type="button" onclick="addItems(3);" class="btn btn-primary btn-sm">
				添加
		</button>
		</td>
		<td colspan="1">
		<button  valign="bottom" type="button" onclick="removeItems(3);" class="btn btn-primary btn-sm">
				重置
		</button>
		</td>
	</tr>
        
   <thead>
		<tr>
			<th>playerId</th>
			<th>puid</th>
			<th>playerName</th>
			<th>level</th>
			<th>isOnline</th>
			<th>status</th>
		</tr>
	</thead>
	<tbody>
		<?php $_from = $this->_tpl_vars['playerInfos']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['playerInfo']):
?>
		<tr>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['id']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['puid']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['name']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['level']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['isOnline']; ?>
</td>
			<td  ><?php echo $this->_tpl_vars['playerInfo']['status']; ?>
</td>
		<tr/>	
		<?php endforeach; endif; unset($_from); ?>
	</tbody>
        
		<tr>
		<td colspan="6" style="width:100%;"> <textarea placeholder="执行结果" id="mul_result" class="comments" rows="5" name="s1" cols="50" onpropertychange="this.style.posHeight=this.scrollHeight"></textarea>
		</td>
		</tr>
	</tbody>
</table>

</center>
</div>
</div>
</div>

<div class ="col-lg-2" >
</div>

<!-- /.page-content --></div>
<!-- /.main-content -->
<script type="text/javascript">
	<?php if ($this->_tpl_vars['channel_0']): ?>
	//全选
	$("#<?php echo $this->_tpl_vars['channel_0']; ?>
_selectAll").click(function(){
		if(this.checked) {
			$("#<?php echo $this->_tpl_vars['channel_0']; ?>
 :checkbox").prop("checked", true); 
		} else {
			$("#<?php echo $this->_tpl_vars['channel_0']; ?>
 :checkbox").prop("checked", false);  
		}
	}); 

	// 反选
	$("#<?php echo $this->_tpl_vars['channel_0']; ?>
_unSelect").click(function () {//全不选  
	     $("#<?php echo $this->_tpl_vars['channel_0']; ?>
 :checkbox").each(function(){
	    	 if(!$(this).is(":checked")) {
	    		 $("#<?php echo $this->_tpl_vars['channel_0']; ?>
 :checkbox").prop("checked", true); 
	    	 } else {
	    		 $("#<?php echo $this->_tpl_vars['channel_0']; ?>
 :checkbox").prop("checked", false); 
	    	 }
	     })
	});
	<?php endif; ?>
	
	<?php if ($this->_tpl_vars['channel_1']): ?>
	//全选
	$("#<?php echo $this->_tpl_vars['channel_1']; ?>
_selectAll").click(function(){
		if(this.checked) {
			$("#<?php echo $this->_tpl_vars['channel_1']; ?>
 :checkbox").prop("checked", true); 
		} else {
			$("#<?php echo $this->_tpl_vars['channel_1']; ?>
 :checkbox").prop("checked", false);  
		}
	}); 

	// 反选
	$("#<?php echo $this->_tpl_vars['channel_1']; ?>
_unSelect").click(function () {//全不选  
	     $("#<?php echo $this->_tpl_vars['channel_1']; ?>
 :checkbox").prop("checked", false); 
	});
	<?php endif; ?>
	
	<?php if ($this->_tpl_vars['channel_2']): ?>
	//全选
		$("#<?php echo $this->_tpl_vars['channel_2']; ?>
_selectAll").click(function(){
		if(this.checked) {
			$("#<?php echo $this->_tpl_vars['channel_2']; ?>
 :checkbox").prop("checked", true); 
		} else {
			$("#<?php echo $this->_tpl_vars['channel_2']; ?>
 :checkbox").prop("checked", false);  
		}
	}); 

	// 反选
	$("#<?php echo $this->_tpl_vars['channel_2']; ?>
_unSelect").click(function () {//全不选  
	     $("#<?php echo $this->_tpl_vars['channel_2']; ?>
 :checkbox").prop("checked", false); 
	});
	<?php endif; ?>
	
	
	<?php if ($this->_tpl_vars['channel_3']): ?>
	//全选
		$("#<?php echo $this->_tpl_vars['channel_3']; ?>
_selectAll").click(function(){
		if(this.checked) {
			$("#<?php echo $this->_tpl_vars['channel_3']; ?>
 :checkbox").prop("checked", true); 
		} else {
			$("#<?php echo $this->_tpl_vars['channel_3']; ?>
 :checkbox").prop("checked", false);  
		}
	}); 

	// 反选
	$("#<?php echo $this->_tpl_vars['channel_3']; ?>
_unSelect").click(function () {//全不选  
	     $("#<?php echo $this->_tpl_vars['channel_3']; ?>
 :checkbox").prop("checked", false); 
	});
	<?php endif; ?>
	
	function view1() {
		$('#view1').css("display", "block");
		$('#view2').css("display", "none");
		$('#view3').css("display", "none");
		$('#view4').css("display", "none");
		$('#view5').css("display", "block");
		$('#view6').css("display", "none");
	}
	
	function view2() {
		$('#view1').css("display", "none");
		$('#view2').css("display", "block");
		$('#view3').css("display", "none");
		$('#view4').css("display", "none");
		$('#view5').css("display", "block");
		$('#view6').css("display", "none");
	}
	
	function view3() {
		$('#view1').css("display", "none");
		$('#view2').css("display", "none");
		$('#view3').css("display", "block");
		$('#view4').css("display", "block");
		$('#view5').css("display", "none");
		$('#view6').css("display", "none");
	}
	
 	function view4() {
		$('#view1').css("display", "none");
		$('#view2').css("display", "none");
		$('#view3').css("display", "none");
		$('#view4').css("display", "none");
		$('#view5').css("display", "none");
		$('#view6').css("display", "block");
	} 
	
	
//全选
$("#selectAll").click(function(){
	if(($(this).attr("checked"))) {
		 $("#servers :checkbox").prop("checked", true); 
	} else {
		$("#servers :checkbox").prop("checked", false); 
	}
	
}); 
// 反选
$("#unSelect").click(function () {//全不选  
     $("#servers :checkbox").prop("checked", false); 
});  	
	
	jQuery(function($) {
		$('.date-picker').datepicker({
			autoclose : true
		}).next().on(ace.click_event, function() {
			$(this).prev().focus();
		});

		var oTable1 = $('#sample-table-2').dataTable({
			"aoColumns" : [ {
				"bSortable" : false
			}, {
				"bSortable" : false
			}, {
				"bSortable" : false
			}
			]
		});
		

	});
	
	
	
	function formSubmit() {
		var game = $('#selectGame').val();
		var platform = $('#platform').val();
		var timeout = $('#timeout').val();
		var command = $('#command').val();
		
		var servers=''; 
		$("input[name='checkboxs']:checked").each(function(){ 
			servers += $(this).val()+','; 
		});
		
		if (!game || !timeout || !command || !servers) {
			alert('请将信息填写完整！');
		} else {
			url = "index.php?mod=Shell&do=showServerList&game="+game+"&platform="+platform+"&servers="+servers+"&command="+command+"&timeout="+timeout;
			window.location.href = url;
		}

	}
	
	function changeRoleInfo(type, id) {
		valueId = "#"+id;
		changeValue = $(valueId).val();
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		
		
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'changePlayerInfo';
		
		param['game']  	= game;
		param['key']  	= type;
		param['value']  = changeValue;
		param['serverUrl']  = selectServer;
		
		$.ajax({
			type:'POST',
			url:'index.php',
			data:param,
			dataType:'html',
			success:function(data) {
				var dataObj = eval("(" + data + ")");//转换为json对象
				if (dataObj.code != 1) {
					alert(dataObj.msg);
				} else {
					alert(dataObj.msg);
					// window.location.href = "index.php";
					window.location.href=window.location.href; // 刷新当前页面
				}
		
			}
		});
		
	}
	
	
	function selectRole(type) {
		var key = "";
		var value = "";
		if(type == "role") {
			key = "role";
			value = $('#user_role').val();
		} else if(type == "puid") {
			key = "puid";
			value = $('#user_puid').val();
		} else if(type == "id") {
			key = "id";
			value = $('#user_id').val();
		}
		
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		if(!game) {
			alert("请选择游戏");
		}else if(!selectServer) {
			alert("请选择服");
		} else {
			url = "index.php?mod=Gm&do=selectUserInfo&action=1&game="+game+"&"+key+"="+value+"&serverUrl="+selectServer+"&type="+type;
			window.location.href = url;  
		}
	}
	
	// 用户操作
	function userOperation(actionId) {
		
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'userOperation';
		
		param['actionId']  		= actionId;
		param['game']  			= game;
		param['serverUrl']  	= selectServer;
		
		$.ajax({
			type:'POST',
			url:'index.php',
			data:param,
			dataType:'html',
			success:function(data) {
				var dataObj = eval("(" + data + ")");//转换为json对象
				if (dataObj.code != 1) {
					alert(dataObj.msg);
				} else {
					alert(dataObj.msg);
				}
			}
		});

	}
	
	function serverOperation(actionId) {
		var game = $('#selectGame').val();
		//var selectServer = $('#selectServer').val(); 
		
		var servers=''; 
		$("input[name='checkboxs']:checked").each(function(){
				servers += $(this).val()+','
		});
		
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'serverOperation';
		
		param['actionId']  		= actionId;
		param['game']  			= game;
		param['servers']  	= servers;
		
		if(!game) {
			alert("请选择游戏");
		} else if(!servers) {
			alert("请选择服");
		} else {
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					$('#result').html(data);
					alert("ok");
					/*
					var dataObj = eval("(" + data + ")");//转换为json对象
					if (dataObj.code != 1) {
						alert(dataObj.msg);
					} else {
						alert(dataObj.msg);
					}
					*/
				}
			});
		}
	}
	// 充值
	function recharge(type) {
		
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var selectChannel1 = $('#selectChannel1').val();
		var selectChannel2 = $('#selectChannel2').val();
		var goodsId = $('#goodsId').val();
		
		var orderId = $('#orderId').val();
		var rechargeMoney = $('#rechargeMoney').val();
		
		if(!game) {
			alert("请选择游戏");
		} else if(!selectServer) {
			alert("请选择服");
		} else if((type == 'id') && !goodsId) {
			alert("请输入商品id");
		} else if((type == 'order') && !rechargeMoney)  {
			alert("请输入充值金额");
		} else {
			var param = {};
			param['mod'] = 'Gm';
			param['do']  = 'recharge';
			
			param['game']  			= game;
			param['serverUrl']  	= selectServer;
			if(type == 'id') {
				param['channel']  		= selectChannel1;
				param['goodsId']  		= goodsId;
			} else if(type == 'order') {
				param['channel']  		= selectChannel2;
				param['orderId']  		= orderId;
				param['rechargeMoney']  		= rechargeMoney;
			}
			
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					var dataObj = eval("(" + data + ")");//转换为json对象
					if (dataObj.code != 1) {
						alert(dataObj.msg);
					} else {
						alert(dataObj.msg);
					}
				}
			});
		}
	}
	
	// 添加装备
	function addEquip() {
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var equipId = $('#equipId').val();
		var equipNum = $('#equipNum').val();
		var starlevel1 = $('#starlevel1').val();
		var starlevel2 = $('#starlevel2').val();
		
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'addEquip';
		
		param['game']  			= game;
		param['serverUrl']  	= selectServer;
		param['equipId']  		= equipId;
		param['equipNum']  		= equipNum;
		param['starlevel1']  	= starlevel1;
		param['starlevel2']  	= starlevel2;
	
		if(!game) {
			alert("请选择游戏");
		} else if(!selectServer) {
			alert("请选择服");
		} else  if(!equipId) {
			alert("请输入装备Id");
		} else if(!equipNum) {
			alert("请输入装备数量");
		} else if(!starlevel1) {
			alert("请输入starlevel1");
		} else if(!starlevel2) {
			alert("请输入starlevel1");
		} else {
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					var dataObj = eval("(" + data + ")");//转换为json对象
					if (dataObj.code != 1) {
						alert(dataObj.msg);
					} else {
						alert(dataObj.msg);
					}
				}
			});
		}
	}
	
	// 发送奖励
	function sendAward() {
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var selectChannel3 = $('#selectChannel3').val();
		var awardMsg = $('#awardMsg').val();
		var awardInfo = $('#awardInfo').val();
		
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'sendAward';
		
		param['game']  			= game;
		param['serverUrl']  	= selectServer;
		param['awardMsg']  		= awardMsg;
		param['awardInfo']  	= awardInfo;
		param['selectChannel']  	= selectChannel3;
		
		if(!game) {
			alert("请选择游戏");
		} else if(!selectServer) {
			alert("请选择服");
		} else  if(!awardMsg) {
			alert("请输入消息内容");
		} else {
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					var dataObj = eval("(" + data + ")");//转换为json对象
					if (dataObj.code != 1) {
						alert(dataObj.msg);
					} else {
						alert(dataObj.msg);
					}
				}
			});
		}
		
	}
	
	// 发送全服奖励
	function sendServerAward() {
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var awardMsg = $('#server_awardMsg').val();
		var awardInfo = $('#server_awardInfo').val();
		
		var servers=''; 
		$("input[name='checkboxs']:checked").each(function(){
				servers += $(this).val()+','
		});
		
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'sendServerAward';
		
		param['game']  			= game;
		param['servers']  		= servers;
		param['awardMsg']  		= awardMsg;
		param['awardInfo']  	= awardInfo;
		
		if(!game) {
			alert("请选择游戏");
		} else if(!servers) {
			alert("请选择服");
		} else  if(!awardMsg) {
			alert("请输入邮件内容");
		} else {
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					$('#result').html(data);
					alert("ok");
				}
			});
		}
	}
	
	
	// 查询单服单用户奖励
	function selectOneUserInfo() {
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var playerIds = $('#test_playerId').val();
		
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'selectMulUserInfo'; 	// 发送单服多玩家奖励
		
		param['game']  			= game;
		param['playerIds']  	= playerIds; // playerIds 用,隔开
		param['awardInfo']  	= awardInfo;
		
		if(!game) {
			alert("请选择游戏");
		} else if(!selectServer) {
			alert("请选择服");
		} else  if(!playerIds) {
			alert("请输入要查询的playerId");
		} else {
			
			url = "index.php?mod=Gm&do=selectMulUserInfo&action=1&game="+game+"&serverUrl="+selectServer+"&playerIds="+playerIds+"&view=3";
			window.location.href = url;  
		}
	}
	
	
	// 查询单服多用户奖励
	function selectMulUserInfo() {
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var playerIds = $('#mul_playerId').val();
		
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'selectMulUserInfo'; 	// 发送单服多玩家奖励
		
		param['game']  			= game;
		param['playerIds']  	= playerIds; // playerIds 用,隔开
		param['awardInfo']  	= awardInfo;
		
		if(!game) {
			alert("请选择游戏");
		} else if(!selectServer) {
			alert("请选择服");
		} else  if(!playerIds) {
			alert("请输入要查询的playerIds");
		} else {
			
			url = "index.php?mod=Gm&do=selectMulUserInfo&action=1&game="+game+"&serverUrl="+selectServer+"&playerIds="+playerIds+"&view=4";
			window.location.href = url;  
			
			/*
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					$('#result').html(data);
					alert("ok");
				}
			});
			*/
		}
	}
	
	
	// 发送单服 多用户奖励(全服操作里面的测试用)
	function sendMulUserAwardTest() {
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var awardMsg = $('#server_awardMsg').val();
		var awardInfo = $('#server_awardInfo').val();
		var playerIds = $('#test_playerId').val();
		
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'sendMulUserAward';
		
		param['game']  			= game;
		param['serverUrl']  	= selectServer;
		param['awardMsg']  		= awardMsg;
		param['awardInfo']  	= awardInfo;
		param['playerIds']  	= playerIds;
		
		if(!game) {
			alert("请选择游戏");
		} else if(!selectServer) {
			alert("请选择服");
		} else  if(!awardMsg) {
			alert("请输入邮件内容");
		} else if (!playerIds) {
			alert("请输入用户playerIds");
		}  else {
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					$('#mul_result').html(data);
					alert("ok");
				}
			});
		}
	}
	
	// 发送单服 多用户奖励
	function sendMulUserAward() {
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var awardMsg = $('#mul_awardMsg').val();
		var awardInfo = $('#mul_awardInfo').val();
		var playerIds = $('#mul_playerId').val();
		
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'sendMulUserAward';
		
		param['game']  			= game;
		param['serverUrl']  	= selectServer;
		param['awardMsg']  		= awardMsg;
		param['awardInfo']  	= awardInfo;
		param['playerIds']  	= playerIds;
		
		if(!game) {
			alert("请选择游戏");
		} else if(!selectServer) {
			alert("请选择服");
		} else  if(!awardMsg) {
			alert("请输入邮件内容");
		} else if (!playerIds) {
			alert("请输入用户playerIds");
		}  else {
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					$('#mul_result').html(data);
					alert("ok");
				}
			});
		}
	}
	
	
	function broadcast(type) {
		
		var game = $('#selectGame').val();
		var servers=''; 
		$("input[name='checkboxs']:checked").each(function(){
				servers += $(this).val()+','
		});
		
	//	var selectServer = $('#selectServer').val(); 
		
		if(type == "chat") {
			var message = $('#broadcast_chat').val();	
		} else if(type == "broad") {
			var message = $('#broadcast_broad').val();	
		}
	
		var param = {};
		param['mod'] = 'Gm';
		param['do']  = 'broadcast';
		
		param['game']  			= game;
		param['servers']  		= servers;
		param['message']  		= message;
		param['type']  			= type;
		
		if(!game) {
			alert("请选择游戏");
		} else if(!servers) {
			alert("请选择服");
		} else  if(!message) {
			alert("请输入广播内容");
		} else {
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					$('#result').html(data);
					alert("ok");	
				/*	
					var dataObj = eval("(" + data + ")");//转换为json对象
					if (dataObj.code != 1) {
						alert(dataObj.msg);
					} else {
						alert(dataObj.msg);
					}
				*/	
				}
			});
		}
	}
	
	
	// 修改公会leader
	function changeLeader() {
		var game = $('#selectGame').val();
		var selectServer = $('#selectServer').val(); 
		var allianceId_1 = $('#allianceId_1').val();
		var leaderId = $('#leaderId').val();
		
		if(!game) {
			alert("请选择游戏");
		} else if(!selectServer) {
			alert("请选择服");
		} else if(!allianceId_1) {
			alert("请输入公会id");
		} else if(!leaderId)  {
			alert("请输入leaderId");
		} else {
			var param = {};
			param['mod'] = 'Gm';
			param['do']  = 'changeLeader';
			
			param['game']  			= game;
			param['serverUrl']  	= selectServer;
			param['allianceId']  	= allianceId_1;
			param['leaderId']  		= leaderId;
			
			$.ajax({
				type:'POST',
				url:'index.php',
				data:param,
				dataType:'html',
				success:function(data) {
					var dataObj = eval("(" + data + ")");//转换为json对象
					if (dataObj.code != 1) {
						alert(dataObj.msg);
					} else {
						alert(dataObj.msg);
					}
				}
			});
		}
	}
	
	// 添加奖励到输入框
	function addItems(id) {
		var itemType 	= $('#itemType'+id).val(); 
		var itemTools 	= $('#itemTools'+id).val(); 
		var itemNum 	= $('#itemNum'+id).val();
		
		var awardInfoId = "";
		if(id == 1) {
			awardInfoId = "awardInfo";
		} else if(id == 2) {
			awardInfoId = "server_awardInfo";
		} else if(id == 3) {
			awardInfoId = "mul_awardInfo";
		}
		
		var awardInfo = $('#'+awardInfoId).val();
		if(!itemType) {
			alert("请选择类别");
			return ;
		}
		if(!itemTools) {
			alert("请选择物品");
			return ;
		}
		if(!itemNum) {
			alert("请输入数量");
			return ;
		}
		if(isNaN(itemNum)){ 
			alert("输入不合法,请输入数字");
			return ;
		} 
		
		if(itemNum < 0) {
			alert("不能输入负数,请输入正整数");
			return ;
		}
		
		var itemStr = itemTools+"_"+itemNum;
		if(awardInfo == "") {
			$('#'+awardInfoId).val(itemStr);
		} else {
			var newItemStr = awardInfo+","+itemStr;
			$('#'+awardInfoId).val(newItemStr);
		}
	}
	
	/**重置奖励 */
	function removeItems(id) {
		
		var awardInfoId = "";
		if(id == 1) {
			awardInfoId = "awardInfo";
		} else if(id == 2) {
			awardInfoId = "server_awardInfo";
		} else if (id == 3) {
			awardInfoId = "mul_awardInfo";
		}
		
		var awardInfo 	= $('#'+awardInfoId).val();
		if(awardInfo != "") {
			$('#'+awardInfoId).val("");
		}
	}
	
	
	window.onload = function(){
	    var select = document.getElementById('selectGame');
	    select.onchange = function(){
	        // 更改值后执行的代码
	       var gameName = jQuery("#selectGame  option:selected").text();
	       var game = $('#selectGame').val();
			url = "index.php?mod=Gm&do=selectUserInfo&action=1&game="+game;
			window.location.href = url;  
	    }
	   
	    
	    if(<?php echo $this->_tpl_vars['view']; ?>
) {
	    	// 显示第几个view
	 	   var viewId = "view_"+"<?php echo $this->_tpl_vars['view']; ?>
";
	 	   document.getElementById(viewId).click();
	    }
	    
	    var itemTypeSelect1 = document.getElementById('itemType1');
		  itemTypeSelect1.onchange = function () {
			  var itemType = $('#itemType1').val();
			  
			  var param = {};
			  param['mod'] = 'Gm';
			  param['do']  = 'getItemByType';  
			  param['itemType']  	= itemType;
			  
			  $.ajax({
					type:'POST',
					url:'index.php',
					data:param,
					dataType:'html',
					success:function(data) {
						var dataObj = eval("(" + data + ")");//转换为json对象
						if(dataObj.length == 0) {
							$("#itemTools1").empty();
							$("#itemTools1").append('<option value="">物品</option>');
							return ;
						}
						var length = dataObj.length;
						$("#itemTools1").empty();
						$("#itemTools1").append('<option value="">物品</option>');
						for(var i=0; i<length; i++) {
						/* 	alert(dataObj[i]['itemId']);							
							alert(dataObj[i]['type']);							
							alert(dataObj[i]['name']);	 */
							var itemInfo = dataObj[i]['type']+"_"+dataObj[i]['itemId'];
							var itemName = dataObj[i]['name'];
							$("#itemTools1").append("<option value='"+itemInfo+"' >"+itemName+"</option>"+"<br/>");
						}
					}
				});
		  }
		  
		  var itemToolsSelect1 = document.getElementById('itemTools1');
		  itemToolsSelect1.onchange = function () {
			  // 清空数量里面的值
			  $("#itemNum1").val("");
		  }
		  
		    var itemTypeSelect2 = document.getElementById('itemType2');
			  itemTypeSelect2.onchange = function () {
				  var itemType = $('#itemType2').val();
				  
				  var param = {};
				  param['mod'] = 'Gm';
				  param['do']  = 'getItemByType';
				  param['itemType']  	= itemType;
				  
				  $.ajax({
						type:'POST',
						url:'index.php',
						data:param,
						dataType:'html',
						success:function(data) {
							var dataObj = eval("(" + data + ")");//转换为json对象
							if(dataObj.length == 0) {
								$("#itemTools2").empty();
								$("#itemTools2").append('<option value="">物品</option>');
								return ;
							}
							var length = dataObj.length;
							$("#itemTools2").empty();
							$("#itemTools2").append('<option value="">物品</option>');
							for(var i=0; i<length; i++) {
							/* 	alert(dataObj[i]['itemId']);							
								alert(dataObj[i]['type']);							
								alert(dataObj[i]['name']);	 */
								var itemInfo = dataObj[i]['type']+"_"+dataObj[i]['itemId'];
								var itemName = dataObj[i]['name'];
								$("#itemTools2").append("<option value='"+itemInfo+"' >"+itemName+"</option>"+"<br/>");
							}
						}
					});
			  }
			  
			  var itemToolsSelect2 = document.getElementById('itemTools2');
			  itemToolsSelect2.onchange = function () {
				  // 清空数量里面的值
				  $("#itemNum2").val("");
			  }
		  
			  
			  var itemTypeSelect3 = document.getElementById('itemType3');
			  itemTypeSelect3.onchange = function () {
				  var itemType = $('#itemType3').val();
				  
				  var param = {};
				  param['mod'] = 'Gm';
				  param['do']  = 'getItemByType';
				  param['itemType']  	= itemType;
				  
				  $.ajax({
						type:'POST',
						url:'index.php',
						data:param,
						dataType:'html',
						success:function(data) {
							var dataObj = eval("(" + data + ")");//转换为json对象
							if(dataObj.length == 0) {
								$("#itemTools3").empty();
								$("#itemTools3").append('<option value="">物品</option>');
								return ;
							}
							var length = dataObj.length;
							$("#itemTools3").empty();
							$("#itemTools3").append('<option value="">物品</option>');
							for(var i=0; i<length; i++) {
							/* 	alert(dataObj[i]['itemId']);							
								alert(dataObj[i]['type']);							
								alert(dataObj[i]['name']);	 */
								var itemInfo = dataObj[i]['type']+"_"+dataObj[i]['itemId'];
								var itemName = dataObj[i]['name'];
								$("#itemTools3").append("<option value='"+itemInfo+"' >"+itemName+"</option>"+"<br/>");
							}
						}
					});
			  }
			  
			  var itemToolsSelect1 = document.getElementById('itemTools3');
			  itemToolsSelect1.onchange = function () {
				  // 清空数量里面的值
				  $("#itemNum3").val("");
			  }
			  
	} 
</script>
<!--  
<div id="wrap"> 
<p>提示：可以输入"1"开头的</p> 
<input id="autoCom" type="text" class="txt"> 
<input id="autoC" type="text" class="txt"> 
</div> 
-->

<script type="text/javascript"> 

(autoComplete={ 
pop_len:10, 
pop_cn:'autoDis', 
hover_cn:'cur', 
source:'<?php echo $this->_tpl_vars['sourceData']; ?>
'.split('|'),
init:function(){ 
this.setDom(); 
return this; 
}, 
bind:function(x){ 
if(x.getAttribute('type') != 'text' || x.nodeName != 'INPUT') 
return null; 
var self = this; 
x.onkeyup = function(e){ 
e = e || window.event; 
var lis = self.pop.getElementsByTagName('li'),lens = self.pop.getElementsByTagName('li').length,n=lens,temp; 
if(e.keyCode == 38){ //键盘up键被按下 
if(self.pop.style.display != 'none'){ 
for(var i=0;i<lens;i++){ //遍历结果数据，判断是否被选中 
if(lis[i].className) 
temp = i; 
else 
n--; 
} 
if(n==0){ //如果没有被选中的li元素，则选中最后一个 
lis[lens-1].className = self.hover_cn; 
this.value = lis[lens-1].innerHTML; 
}else{ //如果有被选中的元素，则选择上一个元素并赋值给input 
if(lis[temp] == lis[0]){ //如果选中的元素是第一个孩子节点则跳到最后一个选中 
lis[lens-1].className = self.hover_cn; 
this.value = lis[lens-1].innerHTML; 
lis[temp].className = ''; 
}else{ 
lis[temp-1].className = self.hover_cn; 
this.value = lis[temp-1].innerHTML; 
lis[temp].className = ''; 
} 
} 
}else //如果弹出层没有显示则执行插入操作，并显示弹出层 
self.insert(this); 
}else if(e.keyCode == 40){ //down键被按下，原理同up键 
if(self.pop.style.display != 'none'){ 
for(var i=0;i<lens;i++){ 
if(lis[i].className) 
temp = i; 
else 
n--; 
} 
if(n==0){ 
lis[0].className = self.hover_cn; 
this.value = lis[0].innerHTML; 
}else{ 
if(lis[temp] == lis[lens-1]){ 
lis[0].className = self.hover_cn; 
this.value = lis[0].innerHTML; 
lis[temp].className = ''; 
}else{ 
lis[temp+1].className = self.hover_cn; 
this.value = lis[temp+1].innerHTML; 
lis[temp].className = ''; 
} 
} 
}else 
self.insert(this); 
}else //如果按下的键既不是up又不是down那么直接去匹配数据并插入 
self.insert(this); 
}; 
x.onblur = function(){ //这个延迟处理是因为如果失去焦点的时候是点击选中数据的时候会发现先无法触发点击事件 
setTimeout(function(){self.pop.style.display='none';},300); 
}; 
return this; 
}, 
setDom:function(){ 
var self = this; 
var dom = document.createElement('div'),frame=document.createElement('iframe'),ul=document.createElement('ul'); 
document.body.appendChild(dom); 
with(frame){ //用来在ie6下遮住select元素 
setAttribute('frameborder','0'); 
setAttribute('scrolling','no'); 
style.cssText='z-index:-1;position:absolute;left:0;top:0;' 
} 
with(dom){ //对弹出层li元素绑定onmouseover，onmouseover 
className = this.pop_cn; 
appendChild(frame); 
appendChild(ul); 
onmouseover = function(e){ //在li元素还没有加载的时候就绑定这个方法，通过判断target是否是li元素进行处理 
e = e || window.event; 
var target = e.srcElement || e.target; 
if(target.tagName == 'LI'){ //添加样式前先把所有的li样式去掉，这里用的是一种偷懒的方式，没有单独写removeClass方法 
for(var i=0,lis=self.pop.getElementsByTagName('li');i<lis.length;i++) 
lis[i].className = ''; 
target.className=self.hover_cn; //也没有写addClass方法，直接赋值了 
} 
}; 
onmouseout = function(e){ 
e = e || window.event; 
var target = e.srcElement || e.target; 
if(target.tagName == 'LI') 
target.className=''; 
}; 
} 
this.pop = dom; 
}, 
insert:function(self){ 
var bak = [],s,li=[],left=0,top=0,val=self.value; 
for(var i=0,leng=this.source.length;i<leng;i++){ //判断input的数据是否与数据源里的数据一致 
if(!!val&&val.length<=this.source[i].length&& this.source[i].substr(0,val.length) == val){ 
bak.push(this.source[i]); 
} 
} 
if(bak.length == 0){ //如果没有匹配的数据则隐藏弹出层 

	/*
	this.pop.style.display='none'; 
	return false; 
	*/
	// 没有匹配的所有都列出来
	for(var i=0,leng=this.source.length;i<leng;i++){ //判断input的数据是否与数据源里的数据一致 
		bak.push(this.source[i]); 
	}
	
}//这个弹出层定位方法之前也是用循环offsetParent，但发现ie跟ff下差别很大（可能是使用方式不当），所以改用这个getBoundingClientRect 
left=self.getBoundingClientRect().left+document.documentElement.scrollLeft; 
top=self.getBoundingClientRect().top+document.documentElement.scrollTop+self.offsetHeight; 
with(this.pop){ 
style.cssText = 'width:'+self.offsetWidth+'px;'+'position:absolute;left:'+left+'px;top:'+top+'px;display:none;'; 
getElementsByTagName('iframe')[0].setAttribute('width',self.offsetWidth); 
getElementsByTagName('iframe')[0].setAttribute('height',self.offsetHeight); 
onclick = function(e){ 
e = e || window.event; 
var target = e.srcElement || e.target; 
if(target.tagName == 'LI') 
self.value = target.innerHTML; 
this.style.display='none'; 
}; 
} 
s = bak.length>this.pop_len?this.pop_len:bak.length; 
for(var i=0;i<s;i++) 
li.push( '<li>' + bak[i] +'</li>'); 
this.pop.getElementsByTagName('ul')[0].innerHTML = li.join(''); 
this.pop.style.display='block'; 
} 
}).init().bind(document.getElementById('awardInfo2')).bind(document.getElementById('autoCom2')); 
</script> 



<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
